package com.zggk.iroad.db;

import com.zggk.iroad.greendao.BhInfoDao;
import com.zggk.iroad.greendao.BhLxInfoDao;
import com.zggk.iroad.greendao.CzfaInfoDao;
import com.zggk.iroad.greendao.DcLxInfoDao;
import com.zggk.iroad.greendao.DieaseInfoDao;
import com.zggk.iroad.greendao.HandleInfoDao;
import com.zggk.iroad.greendao.LogInfoDao;
import com.zggk.iroad.greendao.LxInfoDao;
import com.zggk.iroad.greendao.UserDao;
import com.zggk.iroad.greendao.XcXxInfoDao;

public class EntityManager {
    private static EntityManager entityManager;
    public UserDao userDao;
    private LogInfoDao logInfoDao;
    private DieaseInfoDao dieaseInfoDao;
    private LxInfoDao lxInfoDao;
    private DcLxInfoDao dcLxInfoDao;
    private XcXxInfoDao xcXxInfoDao;
    private BhInfoDao bhInfoDao;
    private BhLxInfoDao bhLxInfoDao;
    private HandleInfoDao handleInfoDao;
    private CzfaInfoDao czfaInfoDao;

    /**
     * 测试表
     *
     * @return
     */
    public UserDao getUserDao() {
        userDao = DaoManager.getInstance().getSession().getUserDao();
        return userDao;
    }

    /**
     * 日志表
     *
     * @return
     */
    public LogInfoDao getLogInfoDao() {
        logInfoDao = DaoManager.getInstance().getSession().getLogInfoDao();
        return logInfoDao;
    }

    /**
     * 病害表
     *
     * @return
     */
    public DieaseInfoDao getDieaseInfoDao() {
        dieaseInfoDao = DaoManager.getInstance().getSession().getDieaseInfoDao();
        return dieaseInfoDao;
    }

    /**
     * 路线表
     *
     * @return
     */
    public LxInfoDao getLxInfoDao() {
        lxInfoDao = DaoManager.getInstance().getSession().getLxInfoDao();
        return lxInfoDao;
    }

    /**
     * 调查类型表
     *
     * @return
     */
    public DcLxInfoDao getDcLxInfoDao() {
        dcLxInfoDao = DaoManager.getInstance().getSession().getDcLxInfoDao();
        return dcLxInfoDao;
    }

    /**
     * 调查类型表
     *
     * @return
     */
    public XcXxInfoDao getXcXxInfoDao() {
        xcXxInfoDao = DaoManager.getInstance().getSession().getXcXxInfoDao();
        return xcXxInfoDao;
    }

    /**
     * 病害表
     *
     * @return
     */
    public BhInfoDao getBhInfoDao() {
        bhInfoDao = DaoManager.getInstance().getSession().getBhInfoDao();
        return bhInfoDao;
    }

    /**
     * 病害类型表
     *
     * @return
     */
    public BhLxInfoDao getBhLxInfoDao() {
        bhLxInfoDao = DaoManager.getInstance().getSession().getBhLxInfoDao();
        return bhLxInfoDao;
    }

    /**
     * 病害类型表
     *
     * @return
     */
    public HandleInfoDao getHandleInfoDao() {
        handleInfoDao = DaoManager.getInstance().getSession().getHandleInfoDao();
        return handleInfoDao;
    }

    /**
     * 处置方案表
     *
     * @return
     */
    public CzfaInfoDao getCzfaInfoDao() {
        czfaInfoDao = DaoManager.getInstance().getSession().getCzfaInfoDao();
        return czfaInfoDao;
    }

    /**
     * 创建单例
     *
     * @return
     */
    public static EntityManager getInstance() {
        if (entityManager == null) {
            entityManager = new EntityManager();
        }
        return entityManager;
    }
}

